<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      //  数组方式有2种
      // 第一种
      // var a1= new Array();
      // 第二种  简写方式
      var a1 = [];
      a1[0] = '张三';
      a1[1] = '李四';
      a1[2] = '程五';
      //空余2个数值
      a1[5] = '姚六';
      console.log(a1);
      //索引
      console.log(a1[2]);   
    </script>
  </body>
</html>
